<template>
  <div class="wechatManage">
    <el-tabs v-model="paneType" type="card" @tab-click="handleTabClick">
      <el-tab-pane label="自定义菜单" name="menu"></el-tab-pane>
      <el-tab-pane label="自动回复" name="reply"></el-tab-pane>
      <el-tab-pane label="客服管理" name="kefu"></el-tab-pane>
      <el-tab-pane label="粉丝管理" name="fans"></el-tab-pane>
      <el-tab-pane label="参数二维码" name="qr"></el-tab-pane>
      <el-tab-pane label="管理员信息" name="admin"></el-tab-pane>
    </el-tabs>
    <wechat-menu v-if="paneType==='menu'"></wechat-menu>
    <wechat-fans v-else-if="paneType==='fans'"></wechat-fans>
    <wechat-reply v-else-if="paneType==='reply'"></wechat-reply>
    <wechat-kefu v-else-if="paneType==='kefu'"></wechat-kefu>
    <wechat-qr v-else-if="paneType==='qr'"></wechat-qr>
    <wechat-admin v-else-if="paneType==='admin'"></wechat-admin>
  </div>
</template>
<script>
  import {mapMutations} from 'vuex'
  import wechatMenu from './menu'
  import wechatFans from './fansList'
  import wechatReply from './autoReply/index'
  import wechatKefu from './kefuManage/index'
  import wechatAdmin from './adminInfo'
  import wechatQr from './paramQrCode'
  export default{
    components: {wechatMenu, wechatFans, wechatReply, wechatKefu, wechatAdmin, wechatQr},
    data () {
      return {
        paneType: this.$route.params.type
      }
    },
    destroyed () {
      this.SET_BREAD_TAIL('')
    },
    methods: {
      ...mapMutations(['SET_BREAD_TAIL']),
      handleTabClick () {
        this.$router.push({ name: 'WechatManage', params: {type: this.paneType} })
      }
    }
  }
</script>
